package game;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer;
import com.badlogic.gdx.physics.box2d.World;
import com.badlogic.gdx.utils.Array;

public class GameWorld {

	World world = new World(new Vector2(-10, 0), false);
	Array<GameEntity> entities = new Array<GameEntity>();
	OrthographicCamera camera = new OrthographicCamera();
	Box2DDebugRenderer renderer = new Box2DDebugRenderer();

	public GameWorld() {
		camera.setToOrtho(false);
		spawnPlayer();
	}

	public void render() {
		Gdx.gl.glClearColor(0, 0, 0, 1);
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

		world.step(1 / 60, 6, 2);

		for (int i = 0; i < entities.size; i++) {
			
		}

		renderer.render(world, camera.combined);
	}

	public void spawnPlayer() {
		Player p = new Player();
		p.createFixture(this);
		entities.add(p);

	}

}
